package zoo;

public class ZooManager {
    private Zoo zoo = new Zoo();

    // 添加动物到动物园
    public void addAnimal(String id, String name, String species) {
        this.zoo.addAnimal(new Animal(id, name, species));
    }

    // 通过ID删除动物
    public void removeAnimal(String id) {
        this.zoo.removeAnimal(id);
    }

    // 通过ID查找动物
    public Animal findAnimalById(String id) {
        return this.zoo.findAnimalById(id);
    }

    // 显示动物园中所有动物
    public void displayAnimals() {
        this.zoo.displayAnimals();
    }

    // 更新动物名字
    public void updateAnimalName(String id, String newName) {
        this.zoo.updateAnimalName(id, newName);
    }

    // 主方法用于测试
    public static void main(String[] args) {
        ZooManager zooManager = new ZooManager();
        zooManager.addAnimal("1", "Lion A", "Lion");
        zooManager.addAnimal("2", "Elephant B", "Elephant");
        zooManager.displayAnimals();
        zooManager.updateAnimalName("1", "Lion Alpha");
        zooManager.displayAnimals();
        Animal animal = zooManager.findAnimalById("2");
        if (animal != null) {
            System.out.println("Found animal: " + animal);
        }
    }
}